﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="AlterarItem.aspx.cs" Inherits="TrabalhoLAP.Views.Cadastro.Item.AlterarItem" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <br />
    <asp:Panel ID="pnlConsulta" runat="server" Height="134px" GroupingText="Consulta">

        <table>
            <tr>
                <td>
                    <asp:Label ID="lblDrcItem" Text="Descrição Item: " runat="server" />
                </td>
                <td>
                    <asp:TextBox ID="txbDrcItem" runat="server" Width="200px"></asp:TextBox>
                </td>
                <td>
                    <asp:Label ID="lblCodItem" Text="Código Item: " runat="server" />
                </td>
                <td>
                    <asp:TextBox ID="txbCodItem" runat="server" Width="200px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblDrcCategoria" Text="Descrição Categoria: " runat="server" />
                </td>
                <td>
                    <asp:TextBox ID="txbDrcCategoria" runat="server" Width="200px"></asp:TextBox>
                </td>
                <td>
                    <asp:Label ID="lblCodCategoria" Text="Código Categoria: " runat="server" />
                </td>
                <td>
                    <asp:TextBox ID="txbCodCategoria" runat="server" Width="200px"></asp:TextBox>
                </td>
                <td>
                    <asp:Label ID="lblStatusRegistro" runat="server" Text="Status Registro: " />
                </td>
                <td>
                    <asp:CheckBox ID="ckbStatusRegistro" runat="server" />
                </td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>
                    <asp:Button ID="btnConsultarItem" Text="Consultar" runat="server" OnClick="consultarItem_Click" /></td>
            </tr>
        </table>

        <br />

        <asp:Panel ID="pnlResultado" runat="server" Height="191px" GroupingText="Resultado" Style="margin-bottom: 12px">

            <asp:GridView ID="gdwResultadoConsulta" runat="server" AutoGenerateColumns="false" CellPadding="3" ForeColor="Black" GridLines="Vertical"
                BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" Width="881px" Style="text-align: center" 
                OnRowDatabound="gdwResultadoConsulta_RowDataBound"
                OnRowCancelingEdit="gdwResultadoConsulta_RowCancelingEdit" 
                OnRowEditing="gdwResultadoConsulta_RowEditing" 
                OnRowUpdating="gdwResultadoConsulta_RowUpdating">

                <AlternatingRowStyle BackColor="#CCCCCC" />
                <FooterStyle BackColor="#CCCCCC" />
                <HeaderStyle Font-Bold="True" ForeColor="Black" BackColor="#CAC9C9" />
                <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="Black" />
                <SortedAscendingCellStyle BackColor="#F1F1F1" />
                <SortedAscendingHeaderStyle BackColor="#808080" />
                <SortedDescendingCellStyle BackColor="#CAC9C9" />
                <SortedDescendingHeaderStyle BackColor="#383838" />


                <Columns>

                    <asp:TemplateField HeaderText="Código Item">
                        <ItemTemplate>
                            <asp:Label ID="gdvLblCodItem" runat="server" Text='<%#Bind("codItem") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="Descrição Item">
                        <EditItemTemplate>
                            <asp:TextBox ID="gdvTxbDrcItem" runat="server" Text='<%#Bind("drcItem") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="gdvLblDrcItem" runat="server" Text='<%#Bind("DrcItem") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="Categoria">
                        <ItemTemplate>
                            <asp:DropDownList ID="gdvddlcodCategoria" Enable="false" runat ="server" DataTextField="drcCategoria" DataValueField="codCategoria"> </asp:DropDownList>
                        </ItemTemplate> 
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="Status Registro">
                        <EditItemTemplate>
                            <asp:CheckBox ID="gdvCkbStatusRegistro" Enable="true" runat="server" Checked='<%#Bind("statusRegistro") %>'></asp:CheckBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="gdvCkbStatusRegistro" Enable="false" runat="server" Checked='<%#Bind("statusRegistro") %>'></asp:CheckBox>
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="">
                        <EditItemTemplate>
                            <asp:Button ID="btnSalvar" runat="server" Text="Salvar" CommandName="Update" />
                            <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" CommandName="Cancel" />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Button ID="btnEditar" runat="server" Text="Editar" CommandName="Edit" />
                        </ItemTemplate>
                    </asp:TemplateField>

                </Columns>
            </asp:GridView>
        </asp:Panel>
    </asp:Panel>
    <br />
    &nbsp;<br />
</asp:Content>